/*
 * Copyright (c) 2020, 2023, 3044483124@qq.com All rights reserved.
 *
 */
package itcast;

/**
 * <p>Project: JavaStudy - MathDemo
 * <p>Powered by jiangbo On 2023-02-04
 * 17:15:22
 * <p>Created by IntelliJ IDEA
 *
 * @author jiangbo [3044483124@qq.com]
 * @version 1.0
 * @since 8/17
 */
public class MathDemo {
    public static void main(String[] args) {
        System.out.println(2 * 3 + 5 * 6 * 10);
        System.out.println(Math.PI);
        System.out.printf("%.4f%n",Math.PI);
        //System.out.printf("%.20s%n",Math.PI );
//1
        System.out.println(Math.round(.9));
//2
        System.out.println(Math.round(1.9));
//1
        System.out.println(Math.round(1.2));
        System.out.println(Math.random());
        System.out.println(Math.random()>.5);
        System.out.println(Math.cos(.5));
        System.out.println(Math.sin(.5));
        //舍去小数
        System.out.println(Math.floor(1.0));
        System.out.println(Math.floor(1.1));
        System.out.println(Math.floor(1.5));
        System.out.println(Math.floor(1.9));
//有小数就入整
        System.out.println("---------------------");
//1
        System.out.println(Math.ceil(1.0));
//2
        System.out.println(Math.ceil(1.1));
//2
        System.out.println(Math.ceil(1.5));
//2
        System.out.println(Math.ceil(1.9));
//8.0
        System.out.println(Math.pow(2,7));
//10
        System.out.println(Math.max(5,10));
//5
        System.out.println(Math.min(5,10));
    }
}


